﻿namespace WebBanhang.Includes
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Data.SqlClient;
    using System.Configuration;

    /// <summary>
    ///		Summary description for dangky.
    /// </summary>
    public partial class dangky : System.Web.UI.UserControl
    {
        //string ma;
        //int sosanpham;

        protected void Page_Load(object sender, System.EventArgs e)
        {
            // Put user code to initialize the page here
        }

        #region Web Form Designer generated code
        override protected void OnInit(EventArgs e)
        {
            //
            // CODEGEN: This call is required by the ASP.NET Web Form Designer.
            //
            InitializeComponent();
            base.OnInit(e);
        }

        /// <summary>
        ///		Required method for Designer support - do not modify
        ///		the contents of this method with the code editor.
        /// </summary>
        private void InitializeComponent()
        {

        }
        #endregion

        protected void btn1_Click(object sender, System.EventArgs e)
        {

            ////sosanpham = (int)Session["sosanpham"];
            ////ma = Request.QueryString["email"];

            ////kiem tra cac thông tin
            //if (txtEmail.Text == "")
            //{
            //    lbl.Text = "Bạn chưa nhập Email";
            //    return;
            //}
            //if (txtfullname.Text == "")
            //{
            //    lbl.Text = "Bạn chưa nhập tên";
            //    return;
            //}
            //if (txtaddress.Text == "")
            //{
            //    lbl.Text = "Bạn chưa nhập địa chỉ ";
            //    return;
            //}
            //if (txttelephone.Text == "")
            //{
            //    lbl.Text = "Bạn chưa nhập điện thoại";
            //    return;
            //}

            //if (txtpassword.Text == "")
            //{
            //    lbl.Text = "Vui lòng nhập Password";
            //}
            //else
            //{
            //    //string connectionString = "Data Source=.\\SQLEXPRESS;Initial Catalog=BANSACHTRUCTUYEN;Integrated Security=True";
            //    string connectionString = "Data Source=.;DataBase=BANSACHTRUCTUYEN;Integrated Security=True;Pooling=False";
            //    SqlConnection connection = new SqlConnection(connectionString);
            //    connection.Open();
            //    SqlCommand cmd = new SqlCommand();
            //    cmd.Connection = connection;
            //    cmd.CommandText = "stor_themnguoidung";
            //    cmd.CommandType = CommandType.StoredProcedure;
            //    //thong so param
                
            //    SqlParameter param;
            //    param = cmd.Parameters.Add("@TENND", SqlDbType.NVarChar, 50);
            //    param.Direction = ParameterDirection.Input;
            //    param.Value = txtfullname.Text;

            //    param = cmd.Parameters.Add("@MATKHAU", SqlDbType.NVarChar, 20);
            //    param.Direction = ParameterDirection.Input;
            //    param.Value = txtpassword.Text;

            //    param = cmd.Parameters.Add("@DIACHI", SqlDbType.NVarChar, 50);
            //    param.Direction = ParameterDirection.Input;
            //    param.Value = txtaddress.Text;

            //    param = cmd.Parameters.Add("@DIENTHOAI", SqlDbType.Int);
            //    param.Direction = ParameterDirection.Input;
            //    param.Value = txttelephone.Text;

            //    param = cmd.Parameters.Add("@EMAIL", SqlDbType.NVarChar, 50);
            //    param.Direction = ParameterDirection.Input;
            //    param.Value = txtEmail.Text;

            //    param = cmd.Parameters.Add("@QUYENHAN", SqlDbType.Int);
            //    param.Direction = ParameterDirection.Input;
            //    param.Value = 0;
               
            //    cmd.ExecuteNonQuery();
            //    //Response.Redirect("orders1.aspx?email="+ ma +"&password="+ txtpassword.Text);
            //    Response.Redirect("default.aspx");
            //    Session["EMAIL"] = txtEmail.Text;
            //    Session["QUYENHAN"] = 0;
            //}

        }
        protected void btn2_Click(object sender, EventArgs e)
        {
            //Response.Redirect("default.aspx");
        }
    }
}

			
						
		
	

